home *** CD-ROM | disk | FTP | other *** search
- **************************************************************************
- **************************************************************************
- LIQUID SPRAY INCLUDE FILE FOR PERSISTENCE OF VISION 3.x
- **************************************************************************
- **************************************************************************
-
- Created by Chris Colefax, 23 May 1997
-
- 1.0 INSTALLATION
- 2.0 QUICK START
- 3.0 OPTIONS
- 3.1 BASIC OPTIONS
- 3.1.1 spray_location
- 3.1.2 spray_direction
- 3.1.3 spray_strength
- 3.2 TIME OPTIONS
- 3.2.1 spray_loop
- 3.2.2 spray_start
- 3.2.3 spray_stop
- 3.2.4 spray_start_time
- 3.2.5 spray_stop_time
- 3.3 PARTICLE OPTIONS
- 3.3.1 particle_count
- 3.3.2 particle_life
- 3.3.3 particle_size
- 3.3.4 particle_stretch
- 3.3.5 particle_dist
- 3.3.6 particle_sep
- 3.3.7 evaporate
- 3.4 NOZZLE OPTIONS
- 3.4.1 nozzle_spin
- 3.4.2 nozzle_angle
- 3.4.3 nozzle_width
- 3.5 BLOB OPTIONS
- 3.5.1 use_blob
- 3.5.2 blob_threshold
- 3.5.3 components_only
- 3.6 ENVIRONMENT OPTIONS
- 3.6.1 spray_gravity
- 3.6.2 spray_sky
- 3.6.3 wind
- 3.7 GROUND PLANE OPTIONS
- 3.7.1 ground_plane
- 3.7.2 ground_dist
- 3.7.3 ground_reflection
- 3.7.4 max_bounces
- 3.7.5 ground_friction
- 3.7.6 puddle_thickness
- 3.7.7 puddle_scale
- 3.8 TEXTURE OPTIONS
- 3.8.1 spray_texture
- 3.8.2 spray_color_map
- 3.8.3 use_color_map
- 3.8.4 color_map_triangle
- 3.8.5 color_map_frequency
- 3.9 TURBULENCE OPTIONS
- 3.9.1 spray_turb
- 3.9.2 scale_turb
- 3.9.3 vel_turb
- 3.9.4 angle_turb
- 3.9.5 spin_turb
- 3.9.6 color_turb
- 3.9.7 wind_turb
- 3.9.8 spray_seed
- 3.10 OTHER OPTIONS
- 3.10.1 spray_clock
- 3.10.2 time_scale
- 3.10.3 flow_rate
-
- 4.0 COPYRIGHT AND LEGAL INFORMATION
- 5.0 CONTACTING THE AUTHOR
-
- **************************************************************************
-
-
- 1.0 INSTALLATION
- **************************************************************************
- Copy the two INC files (Spray.inc and SprayG.inc) to one of the
- directories (folders) in your POVRay library path. Normally this is the
- INCLUDE sub-directory of the directory where you installed POVRay, so if
- you installed POVRay in C:\POVRAY you should copy the files to
- C:\POVRAY\INCLUDE. On a Windows 95 system, this is probably something
- like:
-
- C:\Program Files\POV-Ray for Windows\Include
-
- On UNIX and similar systems, where filenames are case-sensitive, you may
- have to rename the include files to Spray.inc and SprayG.inc, with
- uppercase and lowercase as shown. This will enable you to render the
- sample files without modification.
-
-
- 2.0 QUICK START
- **************************************************************************
- The Liquid Spray include file allows you to generate a whole range of
- spray-type particle objects, such as fountains, hoses, waterfalls, etc.
- It will even generate fireworks! There are many options you can use to
- affect the way the spray is generated; to use any of these you simply add
- the following line to your POVRay scene file:
-
- #declare [variable-name] = [value]
-
- substituting the desired variable name and value where appropriate. After
- you have declared all the options you want to use, you add the following
- line to your POVRay scene file:
-
- #include "Spray.inc"
-
- The Liquid Spray include file will then automatically create the spray
- object for you. Although you don't have to use any of the options (the
- include file will use defaults if you don't specify a variable), you
- will want to use the options listed below to ensure you get the sort of
- spray object that you want.
-
-
- 3.0 OPTIONS
- **************************************************************************
-
- 3.1 BASIC OPTIONS
- ******************
- The variables in this section control the basic features of the liquid
- spray, and should generally be the first variables you declare.
-
- 3.1.1 spray_location
- *********************
- This vector specifies the point from where the spray object originates,
- ie. the point where the spray particles first appear.
- The default value for spray_location is <0, 0, 0>
-
- 3.1.2 spray_direction
- **********************
- This vector specifies the direction of the spray object, ie. the initial
- direction of the spray particles.
- The default value for spray_direction is <0, 1, 0>
-
- 3.1.3 spray_strength
- *********************
- This number specifies the strength of the spray object, ie. the initial
- speed of the spray particles.
- The default value for spray_strength is the length of the spray_direction.
-
-
- 3.2 TIME OPTIONS
- *****************
- The following variables control how the spray object is animated (in
- relation to POVRay's clock variable).
-
- 3.2.1 spray_loop
- *****************
- This true / false variable specifies whether or not to generate a
- perpetually looping spray object (for cyclic animations). If spray_loop
- is true, then the spray object will be visible throughout the animation,
- and it will have a constant spray_strength. If spray_loop is false, you
- can use the following options to control how the spray object is turned
- on or off:
-
- 3.2.2 spray_start
- ******************
- This number specifies the time to turn on the spray object, eg. if you
- use spray_start = .5 then the spray will turn on halfway through the
- animation (presuming the animation clock goes from 0 to 1).
- The default value for spray_start is 0
-
- 3.2.3 spray_stop
- *****************
- This number specifies the time to turn off the spray object, eg. if you
- use spray_stop = .5 then the spray will turn off halfway through the
- animation.
- The default value for spray_stop is 1
-
- 3.2.4 spray_start_time
- ***********************
- This numbers specifies the time it takes for the spray to reach full
- strength, eg. if you use spray_start = .1 and spray_start_time = .3 then
- the spray object will reach full strength at .4
- The default value for spray_start_time is 0
-
- 3.2.5 spray_stop_time
- **********************
- This numbers specifies the time it takes for the spray to turn off, eg.
- if you use spray_stop = .7 and spray_stop_time = .2 then the spray object
- will start to run down at .5, and be fully stopped by .7
- The default value for spray_stop_time is 0
-
-
- 3.3 PARTICLE OPTIONS
- *********************
- Each spray object contains a number of particles. You can use the options
- in this section to specify the characteristics of these particles.
-
- 3.3.1 particle_count
- *********************
- This number specifies the number of particles used to create the spray
- object. If spray_loop is true, then the spray object will always contain
- the same number of particles. If spray_loop is false, then the number of
- particles will change as the spray is turned on and off.
- The default value for particle_count is 100
-
- 3.3.2 particle_life
- ********************
- This number specifies how long each particle is alive, eg. if you use
- particle_life = 1.5, then each particle will disappear after 1.5 units
- of time. If spray_loop is true, then the spray object will be automatically
- adjusted so it always loops correctly.
- The default value for particle_life is 1
-
- 3.3.3 particle_size
- ********************
- This number specifies the size (in POV units) of each spray particle. It
- is actually the radius of the spheres or blob components that make up the
- spray object.
- The default value for particle_size is 1
-
- 3.3.4 particle_stretch
- ***********************
- This number specifies how much to stretch the spray particles by. Numbers
- larger than one make the particle thinner and torpedo shaped, giving the
- effect of movement. Numbers smaller than one make the particles look like
- discs (not recommended).
- The default value for particle_stretch is 1 (ie. no stretch)
-
- 3.3.5 particle_dist
- ********************
- This option can be used to generate a mixture of larger and smaller
- particles, rather than all the particles being the same size. The number
- used specifies the size distribution of the particles, ie. the ratio of
- small particles to large particles:
- 1 - equal numbers of small and large particles
- 0 - all large particles
- between 0 and 1 - more large particles than small particles
- larger than 1 - more small particles than large particles
- The default value for particle_dist is 1
-
- 3.3.6 particle_sep
- *******************
- This option can be used to separate the smaller particles from the larger
- particles, giving the effect of a fine spray surrounding the main spray
- object. It has no effect if particle_dist is 0. Setting particle_sep
- to 0 specifies no separation between the differently sized particles,
- while numbers larger than 0 increase the separation.
- The default value for particle_sep is 0
-
- 3.3.7 evaporate
- ****************
- This number specifies the rate of evaporation of the particles. Setting
- this option to 0 specifies no evaporation, while numbers larger than 0
- will cause the particles to grow smaller until they disappear at the end
- of their lives (see particle_life above). The larger the number, the
- faster the particles disappear.
- The default value for evaporate is false (0)
-
-
- 3.4 NOZZLE OPTIONS
- *******************
- The following options control the characteristics of the spray nozzle:
-
- 3.4.1 nozzle_spin
- ******************
- This option specifies the number of spins the nozzle makes per unit of
- time. Setting nozzle_spin to 0 will stop the nozzle from spinning.
- Negative numbers can be used to spin the nozzle in the opposite direction.
- The default value for nozzle_spin is 1
-
- 3.4.2 nozzle_angle
- *******************
- This option specifies the angle (in degrees) of the spray nozzle. If you
- think of the spray object as a cone, with its apex at spray_location, this
- number is the angle at the apex of the cone (similar to the radius option
- in POVRay's spotlight).
- The default value for nozzle_angle is 20
-
- 3.4.3 nozzle_width
- *******************
- This option can be used to widen the nozzle, for waterfalls and other
- similar spray objects.
- The default value for nozzle_width is 0
-
-
- 3.5 BLOB OPTIONS
- *****************
- Normally the spray object is generated as a union of spheres. You can use
- the following options to generate the spray object as a blob object
- instead:
-
- 3.5.1 use_blob
- ***************
- Setting this option to true will cause the spray object to be generated
- as a blob.
- The default value for use_blob is false
-
- 3.5.2 blob_threshold
- *********************
- This number specifies the threshold of the blob used to create the spray
- object (see the POVRay docs for more information on blob thresholds).
- The default value for blob_threshold is .5
-
- 3.5.3 components_only
- **********************
- This option can be used to generate blob components only, rather than a
- complete blob object. This is useful when you want to combine the liquid
- spray blob with another blob (so the components interact). You will have
- to place the include statement inside the blob {} object, and apply
- textures manually. For an example of this, see the sample scenes that
- came with the Liquid Spray include file.
- The default value for components_only is false
-
-
- 3.6 ENVIRONMENT OPTIONS
- ************************
- The following options can be used to alter the environment in which the
- spray object is created:
-
- 3.6.1 spray_gravity
- ********************
- This number specifies the strength of the gravity force applied to the
- spray particles. Only positive numbers are accepted; the gravity force
- is always in an opposite direction to the spray_sky vector.
- The default value for spray_gravity is 9.8
-
- 3.6.2 spray_sky
- ****************
- This specifies the direction vector that points in the up direction.
- It works in a similar way to the sky keyword in the POVRay camera, and
- it useful when using a different coordinate system (eg. use
- spray_sky = z if the z-axis points upwards). This vector determines the
- direction of the gravity (opposite to the sky, of course) and is also
- used as the normal of the ground plane, if one is specified (see
- section 3.7).
- The default value for spray_sky is <0, 1, 0>
-
- 3.6.3 wind
- ***********
- You can use the wind option to blow the spray particles in a particular
- direction. The direction of the wind vector is the direction in which
- the wind blows, and the size of the wind vector determines the strength
- of the wind force.
- The default value for wind is <0, 0, 0> (no wind)
-
-
- 3.7 GROUND PLANE OPTIONS
- *************************
- The Liquid Spray include file has the ability to add a ground plane
- to the scene. If a spray particle hits this ground plane it can
- automatically splash off it or it can form puddles on the plane.
- Note that the Liquid Spray include file will not actually create a
- ground plane object for you, giving you the option to use any sort of
- object you like to represent the ground.
-
- 3.7.1 ground_plane
- *******************
- This is a true/false value that indicates whether a ground plane is
- present or not.
- The default value for ground_plane is false
-
- 3.7.2 ground_dist
- ******************
- This specifies the distance of the ground from the origin, and is the
- same as the distance value as specified in the plane object. Note that
- the normal direction of the plane is always the same as spray_sky.
- The default value for ground_dist is 0
-
- 3.7.3 ground_reflection
- ************************
- This specifies the amount of energy a spray particle retains after splashing
- off the ground plane. Setting ground_reflection to 1 means that the particle
- retains all its energy, and will bounce back to the same height each time
- it splashes. Setting ground_reflection to 0 means that the particle
- retains none of it's energy after hitting the plane, and therefore it
- forms a puddle. Values in between 0 and 1 will cause the particle to
- splash less high each time it hits the plane, eventually coming to a stop.
- The default value for ground_reflection is .8
-
- 3.7.4 max_bounces
- ******************
- This option specifies the maximum number of times a spray particle will
- splash off the ground plane before forming a puddle.
- The default value for max_bounces is 1
-
- 3.7.5 ground_friction
- **********************
- After a spray particle stops splashing it will form a puddle which slides
- along the ground. The ground_friction options specifies how quickly the
- spray particle stops moving after it forms a puddle. Setting this option
- to 0 causes the particle to stop as soon as it hits the ground. Setting
- this option to 1 causes the particle to slide along without stopping.
- Numbers in between 0 and 1 bring the particle to a gradual stop.
- The default value for ground_friction is .5
-
- 3.7.6 puddle_thickness
- ***********************
- This number specifies how thick the puddles formed by the spray particle
- will be. Setting this option to 1 means that the puddles are as thick as
- original particles, while smaller numbers make the puddles thinner (and
- wider).
- The default value for puddle_thickness is .3
-
- 3.7.7 puddle_scale
- *******************
- You can use this option to artificially alter the size of the puddles, eg.
- puddle_scale = 2 will make the puddles twice as large as normal. This
- is most useful when using blobs (see section 3.5 above), as thin blobs can
- sometimes cause rendering problems.
- The default value for puddle_scale is 1 (no change in puddle size)
-
-
- 3.8 TEXTURE OPTIONS
- ********************
- The following options can be used to change the texture and colour of the
- spray object and its particles:
-
- 3.8.1 spray_texture
- ********************
- This specifies the texture used for the spray object. You can use the
- name of a predefined texture, eg: #declare spray_texture = MyTexture, or
- you can specify a complete texture within a texture {} statement.
- By default a plain blue texture is used.
-
- 3.8.2 spray_color_map
- **********************
- You can use this option to change the color of the spray object over time.
- This option should be declared as a standard color_map, eg:
-
- #declare spray_color_map =
- color_map {[0 rgb <1, 1, 1>] [1 rgb <0, 0, 0>]}
-
- This will cause the spray to gradually change from white at the beginning
- of the animation, to black at the end of the animation.
-
- 3.8.3 use_color_map
- ********************
- You can set this option to false to turn OFF the color_map if you are
- creating multiple spray objects and have already declared spray_color_map,
- which you no longer want to use.
-
- 3.8.4 color_map_triangle
- *************************
- Setting this option to true will cause the color_map to go from 0 to 1,
- and back to 0 (just like using the triangle_map pigment option). This
- is the default if spray_loop is true; otherwise, the default value for
- color_map_triangle is false.
-
- 3.8.5 color_map_frequency
- **************************
- Normally the first color of the spray_color_map is used at the beginning
- of the spray, and the last color is used at the end of the spray. You can
- change this option to have the color_map repeat itself more than once
- through the life of the spray object, using color_map_frequency = 5 will
- make the color_map loop through 5 times.
-
- 3.9 TURBULENCE OPTIONS
- ***********************
- The options is this section can be used to add randomness to certain
- aspects of the spray object. You can use these options to make the
- spray object more (or less) realistic.
-
- 3.9.1 spray_turb
- ***************
- This option controls the overall amount of turbulence added to the
- spray object. Good values range from 0 (no turbulence) to 1 (lots of
- turbulence), but any value can be used. Changing this value will add
- equal turbulence to all aspects of the spray object. If you wish to
- adjust the turbulence of individual areas of the spray object you can use
- the following parameters. (Note that all the individual turbulence
- options are multiplied by spray_turb to find the final turbulence, so you
- will have to make sure that spray_turb is not 0 before using the other
- turbulence options).
- The default value for spray_turb is 0
-
- 3.9.2 scale_turb
- *****************
- This option controls the amount of turbulence added to the scaling of the
- spray particles. It is specified as a factor of the particle size,
- eg. scale_turb = .5 will give particles scaled up to 50% larger or smaller
- than normal.
-
- 3.9.3 vel_turb
- ***************
- This option controls the amount of turbulence added to the velocity of the
- particles. It is specified as a factor of the particle velocity,
- eg. vel_turb = .3 will give particles with velocities up to 30% more or
- less than normal.
-
- 3.9.4 angle_turb
- *****************
- This option controls the amount of turbulence added to the nozzle angle.
- It is specified as a fraction of the nozzle_angle option, eg.
- angle_turb = .4 will give particles with nozzle angles up to 40% more
- or less than normal.
-
- 3.9.5 spin_turb
- ****************
- This option controls the amount of turbulence added to the nozzle spin.
- It is specified as a fraction of 360 degrees, eg. spin_turb = .1 will
- give particles that spin up to 36 degrees away from normal.
-
- 3.9.6 color_turb
- *****************
- This option controls the amount of turbulence added to the color_map.
- color_turb = 1 means that colors will be picked randomly from the
- spray_color_map to color each particle.
-
- 3.9.7 wind_turb
- ****************
- This option controls the amount of turbulence added to the wind direction.
- It is specified as a fraction of 360 degrees, eg. wind_turb = .2 will
- give particles that are blown up to 72 degrees away from normal.
-
- 3.9.8 spray_seed
- *****************
- This option specifies that random number seed used when adding turbulence to
- the spray object. Normally this is 0, but any integer value can be used.
-
-
- 3.10 OTHER OPTIONS
- *******************
-
- 3.10.1 spray_clock
- *******************
- This option specifies the clock value you want to use to generate the
- spray object. By default this is equal to POVRay's internal clock, so
- you shouldn't normally have to use this option. However, there are a
- number of interesting effects you can achieve by using the spray_clock.
- If you use spray_clock = .6, you will get a still scene of the spray
- object, as it would look at .6 units of time. You can also use functions
- of the internal clock, eg:
-
- #declare spray_clock = 1 - clock
-
- will give you a spray object that animates backwards.
-
- 3.10.2 time_scale
- ******************
- This option behaves differently, depending on the spray_loop option. If
- spray_loop is true, then time_scale changes the time taken for the spray
- object to complete one loop, eg. time_scale = 3 will make the spray object
- loop three times per unit of time, rather than once.
- If spray_loop is false, then time_scale gives the effect of increasing (if
- you use a number larger than 1) or decreasing (if you use a number smaller
- than 1) the speed of the spray_particles. However, it has no effect
- on the spray_start, spray_stop, spray_start_time, or spray_stop_time
- options.
- The default value for time_scale is 1
-
- 3.10.3 flow_rate
- *****************
- This option can be used to change the flow rate of the spray object, where
- 0 is off and 1 is full strength. Numbers between 0 and 1 give less than
- full strength, while numbers larger than 1 give more than full strength.
- Normally if you want to turn the spray object on or off you will use the
- options listed in section 3.2. However, you can use the flow_rate option
- to create different effects, eg:
-
- #declare flow_rate = sin(clock * 4 * pi) * .5 + 1
-
- will give an oscillating spray object.
-
-
- 4.0 COPYRIGHT AND LEGAL INFORMATION
- **************************************************************************
- The Liquid Spray Include File, including Spray.inc, SprayG.inc, all
- documentation, and associated sample POV files are Copyright 1997 by
- Chris Colefax. Full permission is granted to the user to modify any or
- all of the files for his/her own use. If modified versions are to be
- distributed the user should make clear the modifications that have been
- made by him/herself. The Liquid Spray Include File may be bundled with
- or without other software on CD-ROM collections, Bulletin Board systems
- and other file archives, providing that all associated files, including
- documentation and samples, are included. I would also request that persons
- intending to distribute the Liquid Spray Include File in this manner or
- otherwise would first contact me (see below for contact information) to
- ensure that they are in possession of the latest version.
-
-
- 5.0 CONTACTING THE AUTHOR
- **************************************************************************
- If you wish to contact me with bug reports, bug fixes, criticisms,
- comments, suggested improvements, questions, etc. you can reach me by
- email at:
-
- ccolefax@geocities.com
-
- or by regular mail at:
-
- Chris Colefax
- PO Box 110
- Kuranda, Queensland
- Australia 4872
-
- **************************************************************************
-
- POV-Ray(tm) and Persistence of Vision(tm) are registered trademarks of the
- POV-Ray Team(tm)
-